<template>
  <!-- 新建档案 -->
  <div class="stu-file-container">
    <div class="nav-section">
      <div class="nav-block">
        <img src="~@/assets/images/icon_home.png">
        <span class="title">方案设计</span>
        <span>管理方案</span>
        <i class="el-icon-arrow-right"></i>
        <span>新建档案</span>
      </div>
      <div class="stu-info" v-show="infos.userType == 3">
        <img src="~@/assets/images/icon_stu.png"/>
        <span>{{ neweditForm.name }}</span>
        <span>{{ neweditForm.sex == 0 ? '男' : '女' }}</span>
        <span>{{ neweditForm.major | filterMajor }}</span>
        <span>分数：{{ neweditForm.score }}</span>
        <span>位次：{{ neweditForm.precedence }}</span>
      </div>
    </div>
    <div class="form-section">
      <form :model="neweditForm" ref="neweditForm">
        <!-- 基础资料 -->
        <div class="title-block">
          <img src="~@/assets/images/file_title_bg.png"/>
          <div class="title">基本资料</div>
        </div>
        <div class="info-block">
          <div class="info-item">
            <div class="item-label">学生姓名</div>
            <el-input class="item-input" v-model="neweditForm.name" placeholder="请输入"></el-input>
          </div>
          <div class="info-item">
            <div class="item-label">科类</div>
            <el-select class="item-select" v-model="neweditForm.major" placeholder="请选择">
              <el-option
                  v-for="item in majorList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
              </el-option>
            </el-select>
          </div>
          <div class="info-item" style="width: 262px">
            <div class="item-label">性别</div>
            <el-radio class="item-radio" v-model="neweditForm.sex" :label="0">男</el-radio>
            <el-radio class="item-radio" v-model="neweditForm.sex" :label="1">女</el-radio>
          </div>
          <div class="info-item">
            <div class="item-label">年龄</div>
            <el-input class="item-input" v-model="neweditForm.age" placeholder="请输入"></el-input>
          </div>
          <div class="info-item">
            <div class="item-label">出生日期</div>
            <el-date-picker class="item-editor-date" v-model="neweditForm.birthdayDate" type="date"
                            placeholder="选择日期"></el-date-picker>
          </div>
        </div>
        <div class="info-block">
          <div class="info-item">
            <div class="item-label">政治面貌</div>
            <el-select class="item-select" v-model="neweditForm.politic" placeholder="请选择">
              <el-option
                  v-for="item in mianmao"
                  :key="item.dictName"
                  :label="item.dictName"
                  :value="item.dictName">
              </el-option>
            </el-select>
          </div>
          <div class="info-item">
            <div class="item-label">民族</div>
            <el-select class="item-select" v-model="neweditForm.nation" placeholder="请选择">
              <el-option
                  v-for="item in minzu"
                  :key="item.dictName"
                  :label="item.dictName"
                  :value="item.dictName">
              </el-option>
            </el-select>
          </div>
          <div class="info-item">
            <div class="item-label">考生类别</div>
            <el-select class="item-select" v-model="neweditForm.stuType" placeholder="请选择">
              <el-option
                  v-for="item in ks"
                  :key="item.value"
                  :label="item.value"
                  :value="item.value">
              </el-option>
            </el-select>
          </div>
          <div class="info-item">
            <div class="item-label">外语语种</div>
            <el-select class="item-select" v-model="neweditForm.languagesMsg" placeholder="请选择">
              <el-option
                  v-for="item in yuzhong"
                  :key="item.dictName"
                  :label="item.dictName"
                  :value="item.dictName">
              </el-option>
            </el-select>
          </div>
          <div class="info-item">
            <div class="item-label">高考年份</div>
            <el-input class="item-input" v-model="neweditForm.other" disabled placeholder="请输入"></el-input>
          </div>
        </div>
        <div class="info-block">
          <div class="info-item">
            <div class="item-label">身高</div>
            <el-input class="item-input-unit" placeholder="请输入" required v-model="neweditForm.height">
              <template slot="append">cm</template>
            </el-input>
          </div>
          <div class="info-item">
            <div class="item-label">体重</div>
            <el-input class="item-input-unit" placeholder="请输入" required v-model="neweditForm.weight">
              <template slot="append">kg</template>
            </el-input>
          </div>
          <div class="info-item">
            <div class="item-label">视力</div>
            <el-input class="item-input" v-model="neweditForm.vision" placeholder="请输入"></el-input>
          </div>
          <div class="info-item">
            <div class="item-label">其他情况</div>
            <el-input class="item-input" v-model="neweditForm.others" placeholder="请输入"></el-input>
          </div>
          <div class="info-item">
            <div class="item-label">体检结论</div>
            <el-cascader
                class="item-cascader-spec"
                ref="myCascader"
                :options="medicalData"
                :props="props"
                v-model="chooseMedical"
                @change="chooseMedicalFn"
                clearable></el-cascader>
            <el-popover
                placement="right"
                width="800"
                trigger="click">
              <div class="conclusion-block" style="height: 400px;overflow-y: auto">
                <p class="conclusion-title">
                  高校在开展录取工作时必须遵守《普通高等学校体检工作指导意见》及有关补充规定，部分专业有附加体检要求的需要在院校招生章程中说明。请根据高考体检结论或阅读文件内容根据自身情况在网页下方勾选对应选项。不含院校补充规定，仅供参考。</p>
                <p class="conclusion-title">一、学校可不予录取</p>
                <p class="conclusion-desc">
                  1.严重心脏病(先天性心脏病经手术治愈，或房室间隔缺损分流量少，动脉导管未闭返流血量少，经二级以上医院专科检查确定无须手术者除外)、心肌病、高血压病。</p>
                <p class="conclusion-desc">2.重症支气管扩张、哮喘，恶性肿瘤、慢性肾炎、尿毒症。</p>
                <p class="conclusion-desc">3.严重的血液、内分泌及代谢系统疾病、风湿性疾病。</p>
                <p class="conclusion-desc">4.重症或难治性癫痫或其他神经系统疾病；严重精神病未治愈、精神活性物质滥用和依赖。</p>
                <p class="conclusion-desc">5.慢性肝炎病人并且肝功能不正常者(肝炎病原携带者但肝功能正常者除外)。</p>
                <p class="conclusion-desc">6.结核病除下列情况外可以不予录取：</p>
                <p class="conclusion-desc">(1)原发型肺结核、浸润性肺结核已硬结稳定；结核型胸膜炎已治愈或治愈后遗有胸膜肥厚者；</p>
                <p class="conclusion-desc">(2)一切肺外结核(肾结核、骨结核、腹膜结核等)、血行性播散型肺结核治愈后一年以上未复发，经二级以上医院(或结核病防治所)专科检查无变化者；</p>
                <p class="conclusion-desc">(3)淋巴腺结核已临床治愈无症状者。</p>

                <p class="conclusion-title">二、学校有关专业可不予录取</p>
                <p class="conclusion-desc">
                  1.轻度色觉异常(俗称色弱)不能录取的专业：以颜色波长作为严格技术标准的化学类、化工与制药类、药学类、生物科学类、公安技术类、地质学类各专业，医学类各专业；生物工程、生物医学工程、动物医学、动物科学、野生动物与自然保护区管理、心理学、应用心理学、生态学、侦查学、特种能源工程与烟火技术、考古学、海洋科学、海洋技术、轮机工程、食品科学与工程、轻化工程、林产化工、农学、园艺、植物保护、茶学、林学、园林、蚕学、农业资源与环境、水产养殖学、海洋渔业科学与技术、材料化学、环境工程、高分子材料与工程、过程装备与控制工程、学前教育、特殊教育、体育教育、运动训练、运动人体科学、民族传统体育各专业。</p>
                <p class="conclusion-desc">
                  2.色觉异常II度(俗称色盲)不能录取的专业，除同轻度色觉异常外，还包括美术学、绘画、艺术设计、摄影、动画、博物馆学、应用物理学、天文学、地理科学、应用气象学、材料物理、矿物加工工程、资源勘探工程、冶金工程、无机非金属材料工程、交通运输、油气储运工程等专业。专科专业：与以上专业相同或相近专业。</p>
                <p class="conclusion-desc">
                  3.不能准确识别红、黄、绿、蓝、紫各种颜色中任何一种颜色的导线、按键、信号灯、几何图形者不能录取的专业：除同轻度色觉异常、色觉异常II度两类列出专业外，还包括经济学类、管理科学与工程类、工商管理类、公共管理类、农业经济管理类、图书档案学类各专业。不能准确在显示器上识别红、黄、绿、蓝、紫各颜色中任何一种颜色的数码、字母者不能录取到计算机科学与技术等专业。</p>
                <p class="conclusion-desc">
                  4.裸眼视力任何一眼低于5.0者，不能录取的专业：飞行技术、航海技术、消防工程、刑事科学技术、侦察。专科专业：海洋船舶驾驶及与以上专业相同或相近专业(如民航空中交通管制)。</p>
                <p class="conclusion-desc">5.裸眼视力任何一眼低于4.8者，不能录取的专业：轮机工程、运动训练、民族传统体育。专科专业：烹饪与营养、烹饪工艺等。</p>

                <p class="conclusion-title">三、不宜就读专业</p>
                <p class="conclusion-desc">
                  1.主要脏器：肺、肝、肾、脾、胃肠等动过较大手术，功能恢复良好，或曾患有心肌炎、胃或十二指肠溃疡、慢性支气管炎、风湿性关节炎等病史，甲状腺机能亢进已治愈一年的，不宜就读地矿类、水利类、交通运输类、能源动力类、公安学类、体育学类、海洋科学类、大气科学类、水产类、测绘类、海洋工程类、林业工程类、武器类、森林资源类、环境科学类、环境生态类、旅游管理类、草业科学类各专业，及土木工程、消防工程、农业水利工程、农学、法医学、水土保持与荒漠化防治、动物科学各专业。专科专业不宜就读烹饪工艺、西餐工艺、面点工艺、烹饪与营养、表演、舞蹈学、雕塑、考古学、地质学、建筑工程、交通土建工程、工业设备安装工程、铁道与桥梁工程、公路与城市道路工程、公路与桥梁工程、铁道工程、工业与民用建筑工程专业。</p>
                <p class="conclusion-desc">2.先天性心脏病经手术治愈，或房室间隔缺损分流量少，动脉导管未闭返流血量少，经二级以上医院专科检查确定无需手术者不宜就读的专业同第三部分第一条。</p>
                <p class="conclusion-desc">3.肢体残疾(不继续恶化)，不宜就读的专业同第三部分第一条。</p>
                <p class="conclusion-desc">
                  4.屈光不正(近视眼或远视眼，下同)任何一眼矫正到4.8、镜片度数大于400度的，不宜就读海洋技术、海洋科学、测控技术与仪器、核工程与核技术、生物医学工程、服装设计与工程、飞行器制造工程。专科专业：与以上相同或相近专业。</p>
                <p class="conclusion-desc">
                  5.任何一眼矫正到4.8、镜片度数大于800度的，不宜就读地矿类、水利类、土建类、动物生产类、水产类、材料类、能源动力类、化工与制药类、武器类、农业工程类、林业工程类、植物生产类、森林资源类、环境生态类、医学类、心理学类、环境与安全类、环境科学类、电子信息科学类、材料科学类、地质学类、大气科学类及地理科学、测绘工程、交通工程、交通运输、油气储运工程、船舶与海洋工程、生物工程、草业科学、动物医学各专业。专科专业：与以上相同或相近专业。</p>
                <p class="conclusion-desc">
                  6.一眼失明另一眼矫正到4.8、镜片度数大于400度的，不宜就读工学、农学、医学、法学各专业及应用物理学、应用化学、生物技术、地质学、生态学、环境科学、海洋科学、海洋技术、生物科学、应用心理学等专业。</p>
                <p class="conclusion-desc">
                  7.两耳听力均在3米以内，或一耳听力在5米另一耳全聋的，不宜就读法学各专业、外国语言文学各专业以及外交学、新闻学、侦察学、学前教育、音乐学、录音艺术、土木工程、交通运输、动物科学、动物医学各专业、医学各专业。</p>
                <p class="conclusion-desc">
                  8.嗅觉迟钝、口吃、步态异常、驼背，面部疤痕、血管瘤、黑色素痣、白瘢风的，不宜就读教育学类、公安学类各专业以及外交学、法学、新闻学、音乐表演、表演各专业。</p>
                <p class="conclusion-desc">9.斜视、嗅觉退钝、口吃不宜就读医学类专业。</p>
              </div>
              <div slot="reference">
                <i class="el-icon-warning-outline" style="font-size: 16px;color: #666;margin-left: 5px"></i>
              </div>
            </el-popover>
          </div>
        </div>
        <div class="info-block">
          <div class="info-item">
            <div class="item-label">就读学校</div>
            <el-input class="item-input" v-model="neweditForm.school" required placeholder="请输入"></el-input>
          </div>
          <div class="info-item">
            <div class="item-label">户籍地址</div>
            <el-cascader class="item-cascader" v-model="neweditForm.address" :options="dz"
                         @change="handleChange"></el-cascader>
          </div>
        </div>
        <div class="info-block">
          <!--          <div class="info-item">-->
          <!--            <div class="item-spec-label">主要联系人</div>-->
          <!--          </div>-->
          <div class="info-item">
            <div class="item-label">主联系人</div>
            <el-input class="item-input" v-model="contactsz.name" required placeholder="请输入"></el-input>
          </div>
          <div class="info-item">
            <div class="item-label">关系</div>
            <el-input class="item-input" v-model="contactsz.relationship" required placeholder="请输入"></el-input>
          </div>
          <div class="info-item">
            <div class="item-label">职业</div>
            <el-input class="item-input" v-model="contactsz.occupation" required placeholder="请输入"></el-input>
          </div>
          <div class="info-item">
            <div class="item-label">电话</div>
            <el-input class="item-input" v-model="contactsz.phone" required placeholder="请输入"></el-input>
          </div>
        </div>
        <div class="info-block">
          <!--          <div class="info-item">-->
          <!--            <div class="item-spec-label">紧急联系人</div>-->
          <!--          </div>-->
          <div class="info-item">
            <div class="item-label">次联系人</div>
            <el-input class="item-input" v-model="contactsb.name" required placeholder="请输入"></el-input>
          </div>
          <div class="info-item">
            <div class="item-label">关系</div>
            <el-input class="item-input" v-model="contactsb.relationship" required placeholder="请输入"></el-input>
          </div>
          <div class="info-item">
            <div class="item-label">职业</div>
            <el-input class="item-input" v-model="contactsb.occupation" required placeholder="请输入"></el-input>
          </div>
          <div class="info-item">
            <div class="item-label">电话</div>
            <el-input class="item-input" v-model="contactsb.phone" required placeholder="请输入"></el-input>
          </div>
        </div>

        <!-- 考试成绩 -->
        <div class="title-block">
          <img src="~@/assets/images/file_title_bg.png"/>
          <div class="title">考试成绩</div>
        </div>
        <p class="tips">
          <i class="el-icon-warning-outline"></i>
          <span>说明:反斜杠前输入框填写考生科目成绩，反斜杠后输入框填写科目满分</span>
        </p>
        <div class="info-block">
          <div class="spec-score-item">考试名称</div>
          <div class="score-item">语文</div>
          <div class="score-item">数学</div>
          <div class="score-item">外语</div>
          <div class="score-item">物理</div>
          <div class="score-item">化学</div>
          <div class="score-item">生物</div>
          <div class="score-item">政治</div>
          <div class="score-item">历史</div>
          <div class="score-item">地理</div>
          <div class="score-item">综合</div>
          <div class="score-item">总分</div>
          <div class="spec-score-item">位次</div>
          <div class="spec-score-item">人数</div>
          <div class="spec-score-item">口试</div>
          <div class="spec-score-item">备注</div>
          <div class="score-item-opt">操作</div>
        </div>

        <!-- 成绩分数显示 -->
        <div class="info-block-show" v-if="achievementList.length > 0" v-for="(item, index) in achievementList">
          <div class="spec-score-item">{{ item.examName }}</div>
          <!--语文-->
          <div class="score-item">
            <span class="score-input">{{ item.language }}</span>
            /
            <span class="score-input">{{ item.languageFull }}</span>
          </div>
          <!--数学-->
          <div class="score-item">
            <span class="score-input">{{ item.mathematics }}</span>
            /
            <span class="score-input">{{ item.mathematicsFull }}</span>
          </div>
          <!--外语-->
          <div class="score-item">
            <span class="score-input">{{ item.foreignLanguages }}</span>
            /
            <span class="score-input">{{ item.foreignLanguagesFull }}</span>
          </div>
          <!--物理-->
          <div class="score-item">
            <span class="score-input">{{ item.physics }}</span>
            /
            <span class="score-input">{{ item.physicsFull }}</span>
          </div>
          <!--化学-->
          <div class="score-item">
            <span class="score-input">{{ item.chemistry }}</span>
            /
            <span class="score-input">{{ item.chemistryFull }}</span>
          </div>
          <!--生物-->
          <div class="score-item">
            <span class="score-input">{{ item.biology }}</span>
            /
            <span class="score-input">{{ item.biologyFull }}</span>
          </div>
          <!--政治-->
          <div class="score-item">
            <span class="score-input">{{ item.politics }}</span>
            /
            <span class="score-input">{{ item.politicsFull }}</span>
          </div>
          <!--历史-->
          <div class="score-item">
            <span class="score-input">{{ item.history }}</span>
            /
            <span class="score-input">{{ item.historyFull }}</span>
          </div>
          <!--地理-->
          <div class="score-item">
            <span class="score-input">{{ item.geography }}</span>
            /
            <span class="score-input">{{ item.geographyFull }}</span>
          </div>
          <!--综合-->
          <div class="score-item">
            <span class="score-input">{{ item.comprehensive }}</span>
            /
            <span class="score-input">{{ item.comprehensiveFull }}</span>
          </div>
          <!--总分-->
          <div class="score-item">
            <span class="score-input">{{ item.totalScore }}</span>
            /
            <span class="score-input">{{ item.totalScoreFull }}</span>
          </div>
          <!--位次-->
          <div class="spec-score-item">
            <span class="score-input">{{ item.ranking }}</span>
          </div>
          <!--人数-->
          <div class="spec-score-item">
            <span class="score-input">{{ item.number }}</span>
          </div>
          <!--口试-->
          <div class="spec-score-item">
            <span class="score-input">{{ item.oralTest }}</span>
          </div>
          <!--备注-->
          <div class="spec-score-item">
            <span class="score-input">{{ item.remarks }}</span>
          </div>
          <!--操作-->
          <div class="score-item-opt">
            <i class="el-icon-delete del" @click="deletePs(index)"></i>
            <i class="el-icon-top sort-up" @click="sortScoreFn(index, -1)"></i>
            <i class="el-icon-bottom sort-down" @click="sortScoreFn(index, 1)"></i>
          </div>
        </div>

        <!-- 添加成绩 -->
        <div class="info-block">
          <el-input class="spec-score-item" v-model="achievementEg.examName" @input="onInput(1)"></el-input>
          <!--语文-->
          <div class="score-item">
            <el-input class="score-input" v-model="achievementEg.language" @input="onInput(1)"></el-input>
            /
            <el-input class="score-input" v-model="achievementEg.languageFull" @input="onInput(11)"></el-input>
          </div>
          <!--数学-->
          <div class="score-item">
            <el-input class="score-input" v-model="achievementEg.mathematics" @input="onInput(1)"></el-input>
            /
            <el-input class="score-input" v-model="achievementEg.mathematicsFull" @input="onInput(11)"></el-input>
          </div>
          <!--外语-->
          <div class="score-item">
            <el-input class="score-input" v-model="achievementEg.foreignLanguages" @input="onInput(1)"></el-input>
            /
            <el-input class="score-input" v-model="achievementEg.foreignLanguagesFull" @input="onInput(11)"></el-input>
          </div>
          <!--物理-->
          <div class="score-item">
            <el-input class="score-input" v-model="achievementEg.physics"
                      @input="onInput(1),comprehensiveInput(1)"></el-input>
            /
            <el-input class="score-input" v-model="achievementEg.physicsFull"
                      @input="onInput(11),comprehensiveInput(11)"></el-input>
          </div>
          <!--化学-->
          <div class="score-item">
            <el-input class="score-input" v-model="achievementEg.chemistry"
                      @input="onInput(1),comprehensiveInput(1)"></el-input>
            /
            <el-input class="score-input" v-model="achievementEg.chemistryFull"
                      @input="onInput(11),comprehensiveInput(11)"></el-input>
          </div>
          <!--生物-->
          <div class="score-item">
            <el-input class="score-input" v-model="achievementEg.biology"
                      @input="onInput(1),comprehensiveInput(1)"></el-input>
            /
            <el-input class="score-input" v-model="achievementEg.biologyFull"
                      @input="onInput(11),comprehensiveInput(11)"></el-input>
          </div>
          <!--政治-->
          <div class="score-item">
            <el-input class="score-input" v-model="achievementEg.politics"
                      @input="onInput(1),comprehensiveInput(1)"></el-input>
            /
            <el-input class="score-input" v-model="achievementEg.politicsFull"
                      @input="onInput(11),comprehensiveInput(11)"></el-input>
          </div>
          <!--历史-->
          <div class="score-item">
            <el-input class="score-input" v-model="achievementEg.history"
                      @input="onInput(1),comprehensiveInput(1)"></el-input>
            /
            <el-input class="score-input" v-model="achievementEg.historyFull"
                      @input="onInput(11),comprehensiveInput(11)"></el-input>
          </div>
          <!--地理-->
          <div class="score-item">
            <el-input class="score-input" v-model="achievementEg.geography"
                      @input="onInput(1),comprehensiveInput(1)"></el-input>
            /
            <el-input class="score-input" v-model="achievementEg.geographyFull"
                      @input="onInput(11),comprehensiveInput(11)"></el-input>
          </div>
          <!--综合-->
          <div class="score-item">
            <el-input class="score-input" v-model="achievementEg.comprehensive"
                      @input="onInput(1),comprehensiveInput(2)"></el-input>
            /
            <el-input class="score-input" v-model="achievementEg.comprehensiveFull"
                      @input="onInput(11),comprehensiveInput(2)"></el-input>
          </div>
          <!--总分-->
          <div class="score-item">
            <el-input class="score-input" v-model="achievementEg.totalScore"></el-input>
            /
            <el-input class="score-input" v-model="achievementEg.totalScoreFull"></el-input>
          </div>
          <!--位次-->
          <div class="spec-score-item">
            <el-input class="score-input" v-model="achievementEg.ranking"></el-input>
          </div>
          <!--人数-->
          <div class="spec-score-item">
            <el-input class="score-input" v-model="achievementEg.number"></el-input>
          </div>
          <!--口试-->
          <div class="spec-score-item">
            <el-input class="score-input" v-model="achievementEg.oralTest"></el-input>
          </div>
          <!--备注-->
          <div class="spec-score-item">
            <el-input class="score-input" v-model="achievementEg.remarks"></el-input>
          </div>
          <!--操作-->
          <div class="score-item-opt">
            <el-button type="warning" plain @click="addPs">添加</el-button>
          </div>
        </div>

        <!-- 升学渠道 -->
        <div class="title-block">
          <img src="~@/assets/images/file_title_bg.png"/>
          <div class="title">升学渠道</div>
        </div>
        <div class="class-block">
          <div class="class-item" v-for="item in channelsList" @change="chooseChannelFn">
            <el-checkbox v-model="item.value">{{ item.label }}</el-checkbox>
          </div>
        </div>
        <div class="class-block">
          <el-input
              type="textarea"
              :rows="4"
              placeholder="请输入内容"
              v-model="specialCategory.remark"
          >
          </el-input>
        </div>

        <!-- 报考意向 -->
        <div class="title-block">
          <img src="~@/assets/images/file_title_bg.png"/>
          <div class="title">报考意向</div>
        </div>
        <div class="info-block">
          <div class="info-item">
            <div class="item-spec-label">志愿意向</div>
          </div>
          <div class="info-item">
            <div class="item-label">学校</div>
            <el-input class="item-input" v-model="examMsg.intentionApply.schoolName" placeholder="请输入"></el-input>
          </div>
          <div class="info-item">
            <div class="item-label">专业</div>
            <el-input class="item-input" v-model="examMsg.intentionApply.professionName"
                      placeholder="请输入"></el-input>
          </div>
          <div class="info-item">
            <div class="item-label">职业</div>
            <el-input class="item-input" v-model="examMsg.intentionApply.occupationName" placeholder="请输入"></el-input>
          </div>
          <div class="info-item">
            <div class="item-label">城市</div>
            <el-input class="item-input" v-model="examMsg.intentionApply.cityName" placeholder="请输入"></el-input>
          </div>
        </div>

        <div class="info-block">
          <div class="info-item">
            <div class="item-spec-label">方案倾向</div>
          </div>
          <div class="info-item" v-for="item in examMsg.scheme">
            <div class="paper-item-label">
              <el-checkbox v-model="item.value">{{item.label}}</el-checkbox>
            </div>
          </div>
        </div>

        <div class="info-block">
          <div class="info-item">
            <div class="item-spec-label">大学规划</div>
          </div>
          <div class="info-item">
            <div class="paper-item-label" v-for="item in examMsg.universityPlanning">
              <el-checkbox v-model="item.value">{{item.label}}</el-checkbox>
            </div>
          </div>
        </div>

        <div class="info-block">
          <div class="info-item">
            <div class="item-spec-label">合作办学</div>
          </div>
          <div class="info-item">
            <div class="paper-item-label" v-for="item in examMsg.cooperativeSchool">
              <el-checkbox v-model="item.value">{{item.label}}</el-checkbox>
            </div>
          </div>
        </div>

        <!-- 体检结论 -->
        <div class="title-block" v-if="false">
          <img src="~@/assets/images/file_title_bg.png"/>
          <div class="title">体检结论</div>
        </div>
        <div class="conclusion-block" v-if="false">
          <p class="conclusion-title">
            高校在开展录取工作时必须遵守《普通高等学校体检工作指导意见》及有关补充规定，部分专业有附加体检要求的需要在院校招生章程中说明。请根据高考体检结论或阅读文件内容根据自身情况在网页下方勾选对应选项。不含院校补充规定，仅供参考。</p>
          <p class="conclusion-title">一、学校可不予录取</p>
          <p class="conclusion-desc">1.严重心脏病(先天性心脏病经手术治愈，或房室间隔缺损分流量少，动脉导管未闭返流血量少，经二级以上医院专科检查确定无须手术者除外)、心肌病、高血压病。</p>
          <p class="conclusion-desc">2.重症支气管扩张、哮喘，恶性肿瘤、慢性肾炎、尿毒症。</p>
          <p class="conclusion-desc">3.严重的血液、内分泌及代谢系统疾病、风湿性疾病。</p>
          <p class="conclusion-desc">4.重症或难治性癫痫或其他神经系统疾病；严重精神病未治愈、精神活性物质滥用和依赖。</p>
          <p class="conclusion-desc">5.慢性肝炎病人并且肝功能不正常者(肝炎病原携带者但肝功能正常者除外)。</p>
          <p class="conclusion-desc">6.结核病除下列情况外可以不予录取：</p>
          <p class="conclusion-desc">(1)原发型肺结核、浸润性肺结核已硬结稳定；结核型胸膜炎已治愈或治愈后遗有胸膜肥厚者；</p>
          <p class="conclusion-desc">(2)一切肺外结核(肾结核、骨结核、腹膜结核等)、血行性播散型肺结核治愈后一年以上未复发，经二级以上医院(或结核病防治所)专科检查无变化者；</p>
          <p class="conclusion-desc">(3)淋巴腺结核已临床治愈无症状者。</p>

          <p class="conclusion-title">二、学校有关专业可不予录取</p>
          <p class="conclusion-desc">
            1.轻度色觉异常(俗称色弱)不能录取的专业：以颜色波长作为严格技术标准的化学类、化工与制药类、药学类、生物科学类、公安技术类、地质学类各专业，医学类各专业；生物工程、生物医学工程、动物医学、动物科学、野生动物与自然保护区管理、心理学、应用心理学、生态学、侦查学、特种能源工程与烟火技术、考古学、海洋科学、海洋技术、轮机工程、食品科学与工程、轻化工程、林产化工、农学、园艺、植物保护、茶学、林学、园林、蚕学、农业资源与环境、水产养殖学、海洋渔业科学与技术、材料化学、环境工程、高分子材料与工程、过程装备与控制工程、学前教育、特殊教育、体育教育、运动训练、运动人体科学、民族传统体育各专业。</p>
          <p class="conclusion-desc">
            2.色觉异常II度(俗称色盲)不能录取的专业，除同轻度色觉异常外，还包括美术学、绘画、艺术设计、摄影、动画、博物馆学、应用物理学、天文学、地理科学、应用气象学、材料物理、矿物加工工程、资源勘探工程、冶金工程、无机非金属材料工程、交通运输、油气储运工程等专业。专科专业：与以上专业相同或相近专业。</p>
          <p class="conclusion-desc">
            3.不能准确识别红、黄、绿、蓝、紫各种颜色中任何一种颜色的导线、按键、信号灯、几何图形者不能录取的专业：除同轻度色觉异常、色觉异常II度两类列出专业外，还包括经济学类、管理科学与工程类、工商管理类、公共管理类、农业经济管理类、图书档案学类各专业。不能准确在显示器上识别红、黄、绿、蓝、紫各颜色中任何一种颜色的数码、字母者不能录取到计算机科学与技术等专业。</p>
          <p class="conclusion-desc">
            4.裸眼视力任何一眼低于5.0者，不能录取的专业：飞行技术、航海技术、消防工程、刑事科学技术、侦察。专科专业：海洋船舶驾驶及与以上专业相同或相近专业(如民航空中交通管制)。</p>
          <p class="conclusion-desc">5.裸眼视力任何一眼低于4.8者，不能录取的专业：轮机工程、运动训练、民族传统体育。专科专业：烹饪与营养、烹饪工艺等。</p>

          <p class="conclusion-title">三、不宜就读专业</p>
          <p class="conclusion-desc">
            1.主要脏器：肺、肝、肾、脾、胃肠等动过较大手术，功能恢复良好，或曾患有心肌炎、胃或十二指肠溃疡、慢性支气管炎、风湿性关节炎等病史，甲状腺机能亢进已治愈一年的，不宜就读地矿类、水利类、交通运输类、能源动力类、公安学类、体育学类、海洋科学类、大气科学类、水产类、测绘类、海洋工程类、林业工程类、武器类、森林资源类、环境科学类、环境生态类、旅游管理类、草业科学类各专业，及土木工程、消防工程、农业水利工程、农学、法医学、水土保持与荒漠化防治、动物科学各专业。专科专业不宜就读烹饪工艺、西餐工艺、面点工艺、烹饪与营养、表演、舞蹈学、雕塑、考古学、地质学、建筑工程、交通土建工程、工业设备安装工程、铁道与桥梁工程、公路与城市道路工程、公路与桥梁工程、铁道工程、工业与民用建筑工程专业。</p>
          <p class="conclusion-desc">2.先天性心脏病经手术治愈，或房室间隔缺损分流量少，动脉导管未闭返流血量少，经二级以上医院专科检查确定无需手术者不宜就读的专业同第三部分第一条。</p>
          <p class="conclusion-desc">3.肢体残疾(不继续恶化)，不宜就读的专业同第三部分第一条。</p>
          <p class="conclusion-desc">
            4.屈光不正(近视眼或远视眼，下同)任何一眼矫正到4.8、镜片度数大于400度的，不宜就读海洋技术、海洋科学、测控技术与仪器、核工程与核技术、生物医学工程、服装设计与工程、飞行器制造工程。专科专业：与以上相同或相近专业。</p>
          <p class="conclusion-desc">
            5.任何一眼矫正到4.8、镜片度数大于800度的，不宜就读地矿类、水利类、土建类、动物生产类、水产类、材料类、能源动力类、化工与制药类、武器类、农业工程类、林业工程类、植物生产类、森林资源类、环境生态类、医学类、心理学类、环境与安全类、环境科学类、电子信息科学类、材料科学类、地质学类、大气科学类及地理科学、测绘工程、交通工程、交通运输、油气储运工程、船舶与海洋工程、生物工程、草业科学、动物医学各专业。专科专业：与以上相同或相近专业。</p>
          <p class="conclusion-desc">
            6.一眼失明另一眼矫正到4.8、镜片度数大于400度的，不宜就读工学、农学、医学、法学各专业及应用物理学、应用化学、生物技术、地质学、生态学、环境科学、海洋科学、海洋技术、生物科学、应用心理学等专业。</p>
          <p class="conclusion-desc">
            7.两耳听力均在3米以内，或一耳听力在5米另一耳全聋的，不宜就读法学各专业、外国语言文学各专业以及外交学、新闻学、侦察学、学前教育、音乐学、录音艺术、土木工程、交通运输、动物科学、动物医学各专业、医学各专业。</p>
          <p class="conclusion-desc">8.嗅觉迟钝、口吃、步态异常、驼背，面部疤痕、血管瘤、黑色素痣、白瘢风的，不宜就读教育学类、公安学类各专业以及外交学、法学、新闻学、音乐表演、表演各专业。</p>
          <p class="conclusion-desc">9.斜视、嗅觉退钝、口吃不宜就读医学类专业。</p>

          <div class="conclusion-item">
            <div class="title">一、学校可不录取</div>
            <el-checkbox-group v-model="xxlq" size="mini">
              <el-checkbox-button v-for="item in cities" :label="item.code" :key="item.code">
                {{ item.name }}
              </el-checkbox-button>
            </el-checkbox-group>
          </div>

          <div class="conclusion-item">
            <div class="title">二、有关专业可不录取</div>
            <el-checkbox-group v-model="zylq" size="mini">
              <el-checkbox-button v-for="item in cities1" :label="item.code" :key="item.code">
                {{ item.name }}
              </el-checkbox-button>
            </el-checkbox-group>
          </div>

          <div class="conclusion-item">
            <div class="title">三、不宜就读专业</div>
            <el-checkbox-group v-model="byjd" size="mini">
              <el-checkbox-button v-for="item in cities2" :label="item.code" :key="item.code">
                {{ item.name }}
              </el-checkbox-button>
            </el-checkbox-group>
          </div>
        </div>

        <!-- 备注说明 -->
        <div class="title-block">
          <img src="~@/assets/images/file_title_bg.png"/>
          <div class="title">备注说明</div>
        </div>
        <div class="prefer-block">
          <div class="prefer-item">
            <el-input class="prefer-input" type="textarea" :rows="4" placeholder="请输入内容"
                      v-model="neweditForm.remarks"></el-input>
          </div>
        </div>

        <div class="save-block">
          <el-button @click="saveFilesFn($event)" type="primary" plain>保存</el-button>
          <el-button @click="goBack()">上一级</el-button>
        </div>
      </form>
    </div>
    <el-dialog :visible.sync="dialogVisibles" width="800px" :close-on-click-modal="false"
               style="text-align: center;font-size: 15px;">
      完成预案咨询后，“建立档案”和“定位专业”页面只能浏览，不能更改保存！
    </el-dialog>
  </div>

</template>
<script>
import {regionData, CodeToText, TextToCode} from 'element-china-area-data'
import {request} from "@/util/request"

// 学校不可录取
const cityOptions = [
  {
    code: '一(1)',
    name: '1'
  }, {
    code: '一(2)',
    name: '2'
  }, {
    code: '一(3)',
    name: '3'
  }, {
    code: '一(4)',
    name: '4'
  }, {
    code: '一(5)',
    name: '5'
  }, {
    code: '一(6)',
    name: '6'
  }
];
const cityOptions1 = [
  {
    code: '二(1)',
    name: '1'
  }, {
    code: '二(2)',
    name: '2'
  }, {
    code: '二(3)',
    name: '3'
  }, {
    code: '二(4)',
    name: '4'
  }, {
    code: '二(5)',
    name: '5'
  }
];
const cityOptions2 = [
  {
    code: '三(1)',
    name: '1'
  }, {
    code: '三(2)',
    name: '2'
  }, {
    code: '三(3)',
    name: '3'
  }, {
    code: '三(4)',
    name: '4'
  }, {
    code: '三(5)',
    name: '5'
  }, {
    code: '三(6)',
    name: '6'
  }, {
    code: '三(7)',
    name: '7'
  }, {
    code: '三(8)',
    name: '8'
  }, {
    code: '三(9)',
    name: '9'
  }
];

// 体检结论选项
const medicalOption = [
  {
    value: '1',
    label: '学校不可录取',
    children: [
      {
        value: '一(1)',
        label: '1'
      }, {
        value: '一(2)',
        label: '2'
      }, {
        value: '一(3)',
        label: '3'
      }, {
        value: '一(4)',
        label: '4'
      }, {
        value: '一(5)',
        label: '5'
      }, {
        value: '一(6)',
        label: '6'
      }
    ]
  },
  {
    value: '2',
    label: '有关专业可不录取',
    children: [
      {
        value: '二(1)',
        label: '1'
      }, {
        value: '二(2)',
        label: '2'
      }, {
        value: '二(3)',
        label: '3'
      }, {
        value: '二(4)',
        label: '4'
      }, {
        value: '二(5)',
        label: '5'
      }
    ]
  },
  {
    value: '3',
    label: '不宜就读专业',
    children: [
      {
        value: '三(1)',
        label: '1'
      }, {
        value: '三(2)',
        label: '2'
      }, {
        value: '三(3)',
        label: '3'
      }, {
        value: '三(4)',
        label: '4'
      }, {
        value: '三(5)',
        label: '5'
      }, {
        value: '三(6)',
        label: '6'
      }, {
        value: '三(7)',
        label: '7'
      }, {
        value: '三(8)',
        label: '8'
      }, {
        value: '三(9)',
        label: '9'
      }
    ]
  },
]
const MajorData = [
  {
    label: '理科类',
    value: 1
  },
  {
    label: '文科类',
    value: 2
  },
  {
    label: '艺术理',
    value: 3
  },
  {
    label: '艺术文',
    value: 4
  },
]

// 升学渠道
const ChannelsData = [
  {
    label: '强基计划',
    value: false
  },
  {
    label: '军队院校',
    value: false
  },
  {
    label: '免费医学定向生',
    value: false
  },
  {
    label: '国家专项计划',
    value: false
  },
  {
    label: '综合评价',
    value: false
  },
  {
    label: '公安本科专业',
    value: false
  },
  {
    label: '全国重点马克思主义学院',
    value: false
  },
  {
    label: '公费师范生',
    value: false
  },
  {
    label: '港、澳独立招生',
    value: false
  },
  {
    label: '司法本科专业',
    value: false
  },
  {
    label: '优师专项',
    value: false
  },
  {
    label: '地方专项计划',
    value: false
  },
  {
    label: '飞行技术专业',
    value: false
  },
  {
    label: '中国消防救援学院',
    value: false
  },
  {
    label: '航海类专业',
    value: false
  },
  {
    label: '定向就业',
    value: false
  },
  {
    label: '高水平运动队',
    value: false
  },
  {
    label: '定向培养军士',
    value: false
  },
  {
    label: '小语种',
    value: false
  },
  {
    label: '民族班',
    value: false
  },
  {
    label: '高校专项计划',
    value: false
  },
  {
    label: '公安高职 (专科) 专业',
    value: false
  },
  {
    label: '种子科学与工程',
    value: false
  },
  {
    label: '少数民族预科班',
    value: false
  },
  {
    label: '空乘、民航空中安保',
    value: false
  },
  {
    label: '北京电子科技学院',
    value: false
  },
  {
    label: '边防军子女预科班',
    value: false
  },
  {
    label: '四川大学预科班',
    value: false
  },
];
// 视力基础数据
const VisionData = [
  {
    label: "4.0",
    value: "4",
  }, {
    label: "4.1",
    value: "4.1",
  }, {
    label: "4.2",
    value: "4.2",
  }, {
    label: "4.3",
    value: "4.3",
  }, {
    label: "4.4",
    value: "4.4",
  }, {
    label: "4.5",
    value: "4.5",
  }, {
    label: "4.6",
    value: "4.6",
  }, {
    label: "4.7",
    value: "4.7",
  }, {
    label: "4.8",
    value: "4.8",
  }, {
    label: "4.9",
    value: "4.9",
  }, {
    label: "5.0",
    value: "5",
  }, {
    label: "5.1",
    value: "5.1",
  }, {
    label: "5.2",
    value: "5.2",
  }, {
    label: "5.3",
    value: "5.3",
  }
];

export default {
  data() {
    return {
      majorList: MajorData,
      dialogVisibles: false,
      achievementList: [],
      achievementEg: {
        examName: null,
        language: null,
        mathematics: null,
        foreignLanguages: null,
        physics: null,
        chemistry: null,
        biology: null,
        politics: null,
        history: null,
        geography: null,
        oralTest: null,
        wenzong: null,
        comprehensive: null,
        totalScore: null,
        languageFull: null,
        mathematicsFull: null,
        foreignLanguagesFull: null,
        physicsFull: null,
        chemistryFull: null,
        biologyFull: null,
        politicsFull: null,
        historyFull: null,
        geographyFull: null,
        oralTestFull: null,
        wenzongFull: null,
        comprehensiveFull: null,
        totalScoreFull: null,
        ranking: null,
        number: null,
        remarks: null,
        level: 1
      },

      // 联系人
      contactsz: {
        name: null,
        relationship: null,
        occupation: null,
        phone: null,
        level: 0
      },
      contactsb: {
        name: null,
        relationship: null,
        occupation: null,
        phone: null,
        level: 1
      },
      // 升学渠道
      channelsList: ChannelsData,
      specialCategory: {
        stuId: null,
        checkMsg: [],
        remark: null
      },
      // 志愿意向
      examMsg: {
        intentionApply: { // 志愿意向
          schoolName: '',
          professionName: '',
          occupationName: '',
          cityName: ''
        },
        scheme: [
          {
            label: '院校优先',
            value: false
          },
          {
            label: '专业优先',
            value: false
          },
          {
            label: '城市优先',
            value: false
          },
          {
            label: '综合考虑',
            value: false
          },
        ],
        universityPlanning: [
          {
            label: '保研',
            value: false
          },
          {
            label: '考研',
            value: false
          },
          {
            label: '留学',
            value: false
          },
          {
            label: '就业',
            value: false
          }
        ],
        cooperativeSchool: [
          {
            label: '合办院校',
            value: false
          },
          {
            label: '合办专业',
            value: false
          },
        ]
      },
      infos: {},
      dz: regionData,
      selectedOptions: [],
      user: {},
      dialogVisible: false,
      minzu: [],
      mianmao: [],
      yuzhong: [],
      hege: false,
      neweditForm: {},
      ks: [{
        id: 1,
        value: "城镇应届",
      }, {
        id: 2,
        value: "城镇往届",
      }, {
        id: 3,
        value: "农村应届",
      }, {
        id: 4,
        value: "农村往届",
      },],
      // 体检结论
      xxlq: [], //学校可不录取
      zylq: [], //有关专业可不录取
      byjd: [], //
      cities: cityOptions,
      cities1: cityOptions1,
      cities2: cityOptions2,
      props: {multiple: true},
      // 体检结论
      medicalData: medicalOption,
      chooseMedical: [],
    }
  },
  filters: {
    filterMajor(value) {
      const major = MajorData.find((item) => item.value == value)
      return major.label
    },
  },
  methods: {
    // 添加分数
    addPs() {
      let temp = Object.assign({}, this.achievementEg)
      this.achievementList.push(temp)
      for (const key in this.achievementEg) {
        this.achievementEg[key] = null
      }
    },
    comprehensiveInput (type) {
      // type 1 实际分数 2 是满分
      if (type == 1) {
        this.achievementEg.comprehensive = null
        this.achievementEg.comprehensiveFull = null
      } else if (type == 2) {
        this.achievementEg.biology = null
        this.achievementEg.chemistry = null
        this.achievementEg.physics = null
        this.achievementEg.biologyFull = null
        this.achievementEg.chemistryFull = null
        this.achievementEg.physicsFull = null
        this.achievementEg.geography = null
        this.achievementEg.history = null
        this.achievementEg.politics = null
        this.achievementEg.geographyFull = null
        this.achievementEg.historyFull = null
        this.achievementEg.politicsFull = null
      }
    },
    onInput(type) {
      // 参数 1 实际分数 11 满分
      if (type == 1) {
        let score = Number(this.achievementEg.language) + Number(this.achievementEg.mathematics) + Number(this.achievementEg.foreignLanguages)
            + Number(this.achievementEg.physics) + Number(this.achievementEg.chemistry) + Number(this.achievementEg.biology) +
            Number(this.achievementEg.politics) + Number(this.achievementEg.history) + Number(this.achievementEg.geography) + Number(this.achievementEg.comprehensive)
        this.achievementEg.totalScore = score
      } else if (type == 11) {
        let score = Number(this.achievementEg.languageFull) + Number(this.achievementEg.mathematicsFull) + Number(this.achievementEg.foreignLanguagesFull)
            + Number(this.achievementEg.physicsFull) + Number(this.achievementEg.chemistryFull) + Number(this.achievementEg.biologyFull) +
            Number(this.achievementEg.politicsFull) + Number(this.achievementEg.historyFull) + Number(this.achievementEg.geographyFull) + Number(this.achievementEg.comprehensiveFull)
        this.achievementEg.totalScoreFull = score
      }
    },
    // 删除分数
    deletePs(index) {
      this.$confirm('确定删除当前成绩吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        if (this.achievementList[index].id != null) {
          this.deleteAchievement(index)
        } else {
          this.achievementList.splice(index, 1)
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
        }
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    // 删除分数
    deleteAchievement(index) {
      request({
        method: 'delete',
        url: 'achievement/deleteAchievement',
        params: {
          id: this.achievementList[index].id
        }
      }).then(res => {
        if (res.code == 200 || res.code == 0) {
          this.achievementList.splice(index, 1)
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
        } else {
          this.$message({
            type: 'success',
            message: '删除失败!'
          });
        }
      })
    },
    // 分数排序
    sortScoreFn(index, type) {
      if ((index == 0 && type == -1) || (index == (this.achievementList.length - 1) && type == 1)) {
        this.$message({
          type: 'warning',
          message: index == 0 ? '已经是第一行!' : '已经是最后一行'
        })
        return
      }
      this.achievementList.splice(index, 1, ...this.achievementList.splice(index + Number(type), 1, this.achievementList[index]))
    },
    // 体检结论
    chooseMedicalFn() {
      this.xxlq = [] // 学校可不录取
      this.zylq = [] // 有关专业可不录取
      this.byjd = [] // 不宜就读专业
      console.log('==体检结论==', JSON.stringify(this.chooseMedical))
      for (let i = 0; i < this.chooseMedical.length; i++) {
        let list = this.chooseMedical[i]
        if (list[0] == 1) {
          this.xxlq.push(list[list.length - 1])
        }
        if (list[0] == 2) {
          this.zylq.push(list[list.length - 1])
        }
        if (list[0] == 3) {
          this.byjd.push(list[list.length - 1])
        }
      }
    },
    // 升学渠道
    chooseChannelFn() {
      let list = []
      this.channelsList.forEach(e => {
        if (e.value) {
          list.push(e.label)
        }
      })
      this.specialCategory.checkMsg = list
    },

    dwzy() {
      this.$router.push({
        path: "/design/stuLocation"
      })
    },
    goBack() {
      this.$router.push({
        path: "/design/management"
      })
    },
    // 保存
    saveFilesFn() {
      if (this.neweditForm.rank == 1 && this.infos.userType == 4) {
        this.$message.error("当前内容不可更改！")
      } else {
        this.saveOrUpdateAdmitted()
        this.savePageData()
      }
    },
    // 保存页面数据
    savePageData () {
      const value = this.neweditForm.address
      if (value != null && value[1] != null && value[2] != null) {
        var dz = CodeToText[value[0]] + '/' + CodeToText[value[1]] + '/' + CodeToText[value[2]]
      } else {
        if (value != null && value[1] != null) {
          dz = CodeToText[value[0]] + '/' + CodeToText[value[1]]
        } else if (value != null) {
          dz = CodeToText[value[0]]
        }
      }
      this.neweditForm.address = dz
      if (this.hege === true) {
        this.neweditForm.isEligible = 1
      } else {
        this.neweditForm.isEligible = 0
      }

      let params =  Object.assign(this.neweditForm, {
        checkMsg: JSON.stringify(this.specialCategory.checkMsg),
        remark: this.specialCategory.remark
      })
      params.stuId = this.neweditForm.id
      params.stuContacts = [this.contactsz, this.contactsb]
      params.examMsg = JSON.stringify(this.examMsg)
      params.stuAchievements = this.achievementList
      // console.log('==保存页面==', JSON.stringify(params))
      request({
        method: 'post',
        url: 'students/saveOrUpdateArchives',
        data: params
      }).then(result => {
        if (result.code == 0 || result.code == 200) {
          this.$message({
            message: '保存成功！',
            type: 'success'
          });
          localStorage.setItem("stu", JSON.stringify(result.data))
        } else {
          this.$message({
            message: result.msg,
            type: 'error'
          });
        }
        this.neweditForm.address = value
      })
    },
    // 获取民族
    getminzu() {
      request({
        method: 'Get',
        url: 'sysDict/getDict',
        params: {
          dictType: 'nation_type'
        }
      }).then(res => {
        this.minzu = res.data
      })
    },
    // 获取政治面貌
    getmianmao() {
      request({
        method: 'Get',
        url: 'sysDict/getDict',
        params: {
          dictType: 'politic_type'
        }
      }).then(res => {
        this.mianmao = res.data
      })
    },
    // 获取语种
    getyuzhong() {
      request({
        method: 'Get',
        url: 'sysDict/getDict',
        params: {
          dictType: 'languages_msg_type'
        }
      }).then(res => {
        this.yuzhong = res.data
      })
    },
    // 学生数据
    getstu () {
      request({
        method: 'get',
        url: 'students/getStu',
        params: {
          Id: this.infos.userId
        }
      }).then(res => {
        this.neweditForm = res.data
        if (this.neweditForm.rank == 1) {
          this.dialogVisibles = true
        }
        if (this.neweditForm.isEligible === 1) {
          this.hege = true
        }
        if (this.infos.address != null) {
          const value = this.infos.address.split("/")
          const s = value[0]
          const shi = value[1]
          const qu = value[2]
          const dq = [TextToCode[s].code, TextToCode[s][shi].code, TextToCode[s][shi][qu].code]
          this.neweditForm.address = dq
        }
        this.formatBaseInfoData(res.data)
        this.getNotAdmitted()
      })
    },
    // 获取体检结论
    getNotAdmitted() {
      request({
        method: 'POST',
        url: 'stuArchivesRel/getNotAdmitted',
        params: {
          stuid: this.neweditForm.id
        }
      }).then(res => {
        let list = []
        res.data.xz.forEach(i => {
          list.push(i.code.toString())
        })
        let tempList = []
        this.medicalData.forEach(item => {
          item.children.forEach(child => {
            list.forEach(e => {
              if (e == child.value) {
                tempList.push([item.value, e])
              }
            })
          })
        })
        this.chooseMedical = tempList
      })
    },
    // 保存体检结论
    saveOrUpdateAdmitted () {
      // 整理参数
      let params = []
      this.medicalData.forEach(item => {
        let tempObj = {
          stuId: this.neweditForm.id,
          infoId: null,
          codeList: []
        }
        item.children.forEach(child => {
          this.chooseMedical.forEach(e => {
            if (e[1] == child.value) {
              tempObj.infoId = item.value
              tempObj.codeList.push(child.value)
            }
          })
        })
        params.push(tempObj)
      })
      request({
        method: 'POST',
        url: 'stuArchivesRel/saveOrUpdateAdmitted',
        data: params
      }).then(res => {
        // console.log(res)
      })
    },
    // 编辑格式化地址
    handleChange(value) {
      this.neweditForm.address = value
    },
    // 获取用户信息
    getStudentInfo () {
      request({
        method: 'get',
        url: '/students/getStudentById',
        params: {
          id: this.neweditForm.id
        }
      }).then(res => {
        if (res.data) {
          this.formatBaseInfoData(res.data)
        }
      })
    },
    // 整理学生档案数据
    formatBaseInfoData (data) {
      // 整理联系人数据
      if (data.stuContacts) {
        data.stuContacts.forEach(i => {
          if (i.level == 0) {
            this.contactsz = i
          } else if (i.level == 1) {
            this.contactsb = i
          }
        })
      }
      // 整理升学渠道
      if (data.checkMsg) {
        let tempCheckMsg = JSON.parse(data.checkMsg)
        tempCheckMsg.forEach(e => {
          this.channelsList.forEach(item => {
            if (e == item.label) {
              item.value = true
            }
          })
        })
        this.specialCategory = {
          stuId: data.id,
          checkMsg: JSON.parse(data.checkMsg),
          remark: data.remark
        }
      }
      // 考试成绩 stuAchievements
      if (data.stuAchievements) {
        this.achievementList = data.stuAchievements
      }
      // 报考意向 examMsg
      if (data.examMsg) {
        this.examMsg = JSON.parse(data.examMsg)
      }
    }
  },
  created() {
    this.infos = this.$route.params.info
    this.infos = JSON.parse(sessionStorage.getItem("user"))
    if (this.infos.userType == 3) {
      this.neweditForm = JSON.parse(localStorage.getItem('stu'))
      if (this.neweditForm.isEligible === 1) {
        this.hege = true
      }
      if (this.neweditForm.address != null && this.neweditForm.address != '' && this.neweditForm.address != '陕西省') {
        const value = this.neweditForm.address.split("/")
        const s = value[0]
        const shi = value[1]
        const qu = value[2]
        const dq = [TextToCode[s].code, TextToCode[s][shi].code, TextToCode[s][shi][qu].code]
        this.neweditForm.address = dq
      } else {
        const s = "陕西省";
        const dq = [TextToCode[s].code]
        this.neweditForm.address = dq
      }

      // 获取体检结论
      this.getNotAdmitted()
      // 获取学生信息
      this.getStudentInfo()

    } else if (this.infos.userType == 4) {
      this.getstu()
    }
    // 获取民族数据
    this.getminzu()
    // 获取正式面貌
    this.getmianmao()
    // 获取语种数据
    this.getyuzhong()

  }
}
</script>

<style lang="stylus" scoped>
pageWidth = 1400px
$color-theme = #f96630
.stu-file-container
  width: pageWidth;
  margin: 0 auto;
  font-size: 14px;

  div
    box-sizing: border-box;

  .nav-section
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 20px 0;
    font-size: 16px;

    .nav-block
      flex 1
      display: flex;
      justify-content: flex-start;
      align-items: center;

      .title
        width: 100px;

      img
        display: block;
        width: 18px;
        height: 18px;
        margin-right: 10px;

      i
        margin: 0 2px;

    .stu-info
      display: flex;
      align-items: center;
      justify-content: center;
      min-width: 166px;
      height: 40px;
      padding: 0 10px;
      font-size: 14px;
      background: #FFF2E7;
      color: #333;

      img
        display: block;
        width: 16px;
        margin-right: 15px;

      span
        margin-left: 10px;

  .form-section
    padding: 0 20px;
    background: #fff;
    border-radius: 6px;

    .title-block
      position: relative;
      width: 100%;
      padding: 20px 0;
      font-size: 18px;

      .title
        position: absolute;
        top: 20px;
        left: 45px;
        z-index: 0;
        line-height: 30px;
        color: #fff;

      img
        display: block;
        width: 164px;
        height: 30px;

    .tips
      height: 30px;
      line-height: 30px;
      font-size: 16px;
      color: #999;

    .info-block, .info-block-show
      display: flex;
      align-items: center;
      padding: 10px 0

      .info-item
        display: flex;
        align-items: center;
        padding-bottom: 16px;

        .item-label
          width: 72px;
          margin-right: 10px;
          text-align: right;

        .paper-item-label
          width: 100px;
          margin-right: 10px;

        .item-input, .item-select, .item-editor-date, .item-cascader, .item-input-unit
          width: 180px;
          height: 40px;

        .item-cascader-spec
          width: 180px;

        .item-radio
          width: 60px;
          margin-right: 0;

        .item-spec-label
          width: 120px;

      .spec-score-item
        flex: 1;
        color: #333;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 2px;

      .score-item
        flex: 1.4;
        color: #333;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 5px;

      .score-item-opt
        width: 80px;
        padding: 0 5px;
        color: #333;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;

    .info-block-show
      background: #F9F9F9;

      .score-item-opt
        justify-content: space-between;

    .class-block
      padding: 10px 0
      display: flex
      flex-wrap wrap

      .class-item
        width 25%
        padding-bottom: 16px;
        display: flex;
        align-items: center;

        .class-label
          width: 80px;
          padding-right: 6px;
          text-align: right;

        .class-textarea
          flex: 1;

    .prefer-title
      height: 30px;
      line-height: 30px;
      font-size: 18px;
      font-weight: 500;
      color: #FC6621;

    .prefer-block
      padding: 10px 0

      .prefer-item
        padding-bottom: 16px;
        display: flex;
        align-items: center;

        .prefer-input
          margin-left: 10px;

    .conclusion-block
      padding: 10px 0
      font-size: 16px;

      .conclusion-title
        line-height: 36px;
        font-weight: 500;
        color: #333;

      .conclusion-desc
        line-height: 30px;
        color: #666;

      .conclusion-item
        display: flex;
        align-items: center;
        padding: 10px 0;

        .title
          width: 170px;
          margin-right: 30px;
          line-height: 36px;
          font-weight: 500;
          color: #333;

    .save-block
      padding-bottom: 50px;
      text-align: center;
</style>
<style lang="stylus">
$color-theme = #f96630
.stu-file-container
  .form-section
    .info-block
      .score-item, .spec-score-item
        .el-input__inner
          padding: 0 4px;

  .score-item-opt
    .del
      color: #ff0000;

    .sort-up
      color: #67C23A;

    .sort-down
      color: $color-theme;

</style>
